<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<link href="<c:url value="/css/style.css"/>" rel="stylesheet">
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>员工管理系统 - 注册</title>
    <link rel="stylesheet" href="../../css/style.css">
</head>
<body>
<div class="login-container">
    <h1>注册管理员</h1>
    <form action="register" method="post">
        <input type="hidden" name="role" value="admin">
        <div class="form-group">
            <label for="userId">管理员ID:</label>
            <input type="text" id="userId" name="userId" required>
        </div>
        <div class="form-group">
            <label for="username">姓名:</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
        </div>
        <div class="form-group">
            <label for="confirmPassword">确认密码:</label>
            <input type="password" id="confirmPassword" name="confirmPassword" required>
        </div>
        <button type="submit">注册</button>
        <div class="form-footer">
            <a href="home">取消注册</a>
        </div>
        <% if (request.getAttribute("error") != null) { %>
        <div class="error-message">${error}</div>
        <% } %>
    </form>
</div>
</body>
</html>